﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.Mvc;

namespace Cormant.Mvc.Web
{
    public abstract class MvcInput : MvcControl
    {
        #region InputControl : Constructors.
        public MvcInput(HtmlHelper html, string id)
            : base(html, id)
        { }
        #endregion

        #region InputControl : Properties.
        [HtmlAttribute("size")]
        public int Columns { get; set; }

        [HtmlAttribute("disabled", IgnoredValue = false)]
        protected bool Disabled { get; set; }

        public bool Enabled
        {
            get { return !this.Disabled; }
            set { this.Disabled = !value; }
        }

        [HtmlAttribute("type")]
        protected abstract string Type { get; }

        [HtmlAttribute("value")]
        public string Value { get; set; }
        #endregion
    }
}
